import $store from './../../store';
// 获取本地的值，防止刷新导致url参数丢失
async function getUrlParameter() {
  //活动ID
  let activityId = $store.state.buyTicket.activityId || '';
  if (!activityId) {
    $store.state.buyTicket.activityId = sessionStorage.getItem('activityIdUcan') || '';
  }

  //票类型id
  let ticketTypeId = $store.state.buyTicket.ticketTypeId || '';
  if (!ticketTypeId) {
    $store.state.buyTicket.ticketTypeId = sessionStorage.getItem('ticketTypeIdUcan') || '';
  }


  //组织corpId
  let corpId = $store.state.buyTicket.corpId || '';
  if (!corpId) {
    $store.state.buyTicket.corpId = sessionStorage.getItem('corpIdUcan') || '';
  }

  //agereeId《购票服务协议》
  let agereeId = $store.state.buyTicket.agereeId || '';
  if (!agereeId) {
    $store.state.buyTicket.agereeId = sessionStorage.getItem('agereeIdUcan') || '';
  }
  return new Promise((resolve) => {
    resolve('ok');
  });
}



export {
  getUrlParameter
};
